package jmine.tec.report.impl.table.pdf;

import java.io.IOException;

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;

import jmine.tec.report.api.ReportElement;
import jmine.tec.report.impl.table.ReportElementNewPage;
import jmine.tec.report.pdf.ReportElementPDFRenderer;

/**
 * 
 * @author adalberto.kishi
 *
 */
public class NewPagePDFRenderer implements ReportElementPDFRenderer {

    /**
     * {@inheritDoc}
     */
    public void render(Document document, ReportElement element) throws IOException {
        try {
            document.newPage();
        } catch (DocumentException e) {
            //não deveria acontecer
            throw new IOException(e.getMessage());
        }
    }

    /**
     * {@inheritDoc}
     */
    public String getRendererType() {
        return ReportElementNewPage.RENDERER;
    }

}
